package com.k8.exchange;

import com.k8.rpc.url.URL;
import com.key.w8.http1.connection.environment.ClientPoolEnvironment;
import com.key.w8.http1.connection.environment.Http1Environment;
import com.key.w8.http1.endpoint.ServerEnvironment;

/**
 * @Author: k8
 * @CreateTime: 2025-03-26
 * @Version: 1.0
 * 将URL配置转换成对应
 */
public class EnvironmentUtil {
    //消费者端可能对应的是一个填充的url，所以在转换配置时获取端口等的时候需要通过URLAddress进行获取
    public static ClientPoolEnvironment urlConvert2ClientEnvironment(URL url) {
        ClientPoolEnvironment clientPoolEnvironment = new ClientPoolEnvironment();
        if (url == null) {
            return clientPoolEnvironment;
        }
        //todo 做转换,目前使用默认的
        return clientPoolEnvironment;
    }

    public static Http1Environment urlConvert2ServerEnvironment(URL url) {
        Http1Environment environment = new ServerEnvironment();
        if (url == null) {
            return environment;
        }
        //todo 做转换
        return environment;
    }
}
